<?php
global_config::get_instance()->add_server_class("SoapCharacteristic","soap_characteristic");
  class soap_characteristic{
  	public $Start;
  	public $Both;
  	public $End;
  	public $Type;  	
  	
  	public function save_to_db() {
  		$dba = db_adapter::get_instance();
		
		$chain_characteristic_type = new chain_characteristic_type();
		$chain_characteristic_type->chain_characteristic_type_name->set_value($this->Type);
		$chain_characteristic_type->chain_characteristic_type_description->set_value(substr($this->Type, strrpos($this->Type, '.')+1));
		 				
		$dba->save_unique($chain_characteristic_type);
		
		$chain_characteristic = new chain_characteristic();
		$chain_characteristic->chain_characteristic_type_id->set_value($chain_characteristic_type->chain_characteristic_type_id->get_value());
		$chain_characteristic->start_value->set_value($this->Start);
		$chain_characteristic->both_value->set_value($this->Both);
		$chain_characteristic->end_value->set_value($this->End);
		$chain_characteristic->chain_id->set_value($this->chain_id);
	
		$dba->save_unique($chain_characteristic);
			
		return $chain_characteristic->chain_characteristic_id->get_value();
	}	
  	
 }
?>